package com.design.alex.iterator;

/**
 * @ClassName : IteratorPatternDemo
 * @Description : todo
 * @Author : Alex
 * @Date: 2020-02-19 14:33
 */
public class IteratorPatternDemo {
    public static void main(String[] args) {
        NameRepository namesRepository = new NameRepository();

        for(Iterator iter = namesRepository.getIterator(); iter.hasNext();){
            String name = (String)iter.next();
            System.out.println("Name : " + name);
        }
    }
}
